<template>
  <div>
    <h1>我是哥哥,我开的车是{{ car }}</h1>
    <button @click="changeCar">找了女朋友给我换车了</button>
  </div>
</template>

<script>
import PubSub from "pubsub-js";
export default {
  name: "Elder",
  data() {
    return {
      car: "八手奥拓",
    };
  },
  methods: {
    changeCar() {
      this.car = "二手奥迪";
      
      PubSub.publish("getCar", this.car);
    },
  },
};
</script>

<style></style>
